Carlos Garnacho [Fri, 26 Jan 2024 19:25:02 +0000 (20:25 +0100)]
keyboard: Drop dead code
This getGroups() method was not called anywhere for
a long time, the last user was dropped at commit 8fdf47ea5b ("keyboard: Do not create widgetry for
all keyboard groups at once").
Carlos Garnacho [Fri, 26 Jan 2024 19:22:14 +0000 (20:22 +0100)]
keyboard: Simplify group change emission at KeyboardController
Since we now just store the current group, we do not need to track
closely source changes vs selection changes in the available sources.
We just re-generate the current OSK keymap for all, so coalesce both
signals into a more generic "group-changed".
Carlos Garnacho [Fri, 26 Jan 2024 18:54:39 +0000 (19:54 +0100)]
keyboard: Honor emoji-visible through input hints
And fix it so it is effective again. This is a small piece of
smarts the code needs to earn, so that keys with the "emoji"
action are hidden, and their width assigned to the next key.
Carlos Garnacho [Fri, 26 Jan 2024 18:12:11 +0000 (19:12 +0100)]
keyboard: Refer to levels by name instead of index
And drop some more guesswork in the code, since some layouts have
less than 4 levels. This also allows for having OSK maps with more
than 4 levels. Let us hope that the sanity of our future kin will
remain below that threshold.
Carlos Garnacho [Fri, 26 Jan 2024 17:04:18 +0000 (18:04 +0100)]
keyboard: Replace Keypad object with a "digits" JSON OSK keymap
Drop some code, in favor of a numeric keypad that is driven through
the same JSON-based maps. This is also a first use of the "height"
key property in the JSON files, for the Enter key.
Carlos Garnacho [Fri, 26 Jan 2024 16:42:52 +0000 (17:42 +0100)]
keyboard: Allow for terminal variants in specific languages
Do not hardcode the us-terminal OSK keymap, and append '-extended'
to the current group name, accounting with the existing 'us' fallback.
This allows for concerned individuals to propose language-specific
terminal layouts.
Carlos Garnacho [Fri, 26 Jan 2024 15:32:19 +0000 (16:32 +0100)]
keyboard: Handle extended keyboards through TERMINAL input purpose
Drop the channeling of this specific signal from the InputMethod, and
update the OSK Keyboard object to using the purpose hint to find out
whether a extended keymap is necessary.
Carlos Garnacho [Fri, 26 Jan 2024 15:20:30 +0000 (16:20 +0100)]
keyboard: Forward input purpose from KeyboardController
Instead of adding more emoji/keypad signals, forward the input
purpose, so that in future commits the Keyboard object can figure
out the right layout from the purpose hint.
Carlos Garnacho [Fri, 26 Jan 2024 13:25:57 +0000 (14:25 +0100)]
keyboard: Add/document "height" optional property
This will allow OSK descriptions to declare "tall" keys. May be
used in combination with the "start" property added in previous
commits, in case a gap needs to be explicitly left.
Carlos Garnacho [Fri, 26 Jan 2024 12:07:00 +0000 (13:07 +0100)]
keyboard: Add/document "leftOffset" optional property on OSK keys
This optional property defines the offset the a key should have
relative to the previous key (on its left) or the start of the
column if it is the first key. If this property is not
present, the key will be placed with no relative offset.
This for example allows keymaps to explicitly define the padding
of the rows that are not "full" relative to other rows, without
guesswork in the code. It is used for this purpose in the
keymaps/levels/rows that needed it.
Carlos Garnacho [Fri, 26 Jan 2024 11:02:30 +0000 (12:02 +0100)]
keyboard: Simplify key width handling
We do not need to store the key width in the Key object
itself when constructing the layout, and can attach it
to the grid from the model data right away.
Sebastian Keller [Fri, 21 Apr 2023 22:05:22 +0000 (00:05 +0200)]
keyboard: Delete selected text on backspace
Previously backspace would only ever remove a single character left of
the cursor, regardless of selection.
This requires the application to correctly set the anchor position in
text_input::set_surrounding_text(), which currently only gtk4 seems to
do. When there is no selection or on other applications that always set
cursor = anchor, like gtk3 does, the behavior is not changed and still
only deletes one character.
Sebastian Keller [Wed, 21 Feb 2024 14:20:24 +0000 (15:20 +0100)]
keyboard: Fix deleting the previous word
Since mutter@33088d59 the cursor we receive from mutter already is a
character index while the code here still treated it like a byte offset.
Further the code to detect the previous word position was treating the
cursor parameter already like a character index, while passing the
cursor that was prior to that commit a byte offset.
The function also had some unreachable and redundant code paths. The
pos < 0 case can never be reached due to the max(). Also the regex
already ensures that all whitespace is considered, so the code to remove
spaces not actually do anything except when deleting the first word in
the text, in which it would cause the first character to not get
deleted.
Also it was not handling characters with more than 2 bytes correctly. In
the presence of these JS string functions, such as search(), can not be
considered to operate on character indices anymore but rather the number
of UTF-16 byte pairs. Issues with this can be avoided by using
iterators, which unlike anything else iterate on characters, not byte
pairs and by not using the results returned by JS string functions for
anything but JS strings.
Given that this may lead to the shell to hang on gdm startup, and that
we expect the service to be up and running quickly, we can safely set a
5 seconds timeout instead of using the longer GLib proxy defaults.
gdm/util: Use fully async call to setup the fingerprint device proxy
Since fingerprint service can now be started also if a conversation has
already began, we can also initialize the proxy asynchronously, without
the risk that the service won't be started early enough.
As per this, remove the usage of FprintDeviceProxy wrapper completely
since it's just not giving us anything here.
gdm/util: Only start fingerprint service synchronously when it's default
On ShellUserVerifier construction we used to start fprintd in a sync
fashion all the times, however in case the daemon had startup failures
or was hanging for whatever reason (like due to devices probing, given
that fprintd synchronously wait for them all to be initialized) we used
to just fail, leaving gdm or the lockscreen in a not usable state.
While this could be prevented with a try/catch statement, there's no
much point to wait for fprintd if that's not the default authentication
service, and so:
- If we use gdm-fingerprint as default auth method, use a sync call to
initialize it and in case of failures, just continue with fallback
authentication mechanism (password)
- Otherwise, asynchronously initialize fprintd and continue with the
ShellUserVerifier without fingerprint support until we got a reply.
In case the service fails to deliver us a result, we don't give up
but we will try doing that at each authentication via
_checkForFingerprintReader().
In case all works properly, as per the previous commit, once the
initialization is done, we'll start the fingerprint PAM gdm service.
gdm/util: Only initialize fingerprint and smart card managers if needed
There's no point to initialize the fprint proxy and the smartcard
manager if they are disabled in authentication settings, so just avoid
initializing them, but at the same time this implies tracking of user
changes and so:
- If a new service has been enabled, we initialize it
- If a service has been disabled we destroy it and reset the
authentication if such service was currently active
gdm/util: Keep track of started services that are currently active
If we have a late activation of a service backend we may need to check
whether it has been already started, and in case it has not, we can try
loading it.
So rely on gdm to see what service has been started, instead of handling
it manually on our side only.
Daniel van Vugt [Fri, 23 Feb 2024 07:29:56 +0000 (15:29 +0800)]
theme: Don't give login-dialog another background-color
Its parent `lockDialogGroup` has exactly the same background-color
set in the same file. Giving them both the same wasted render time on
overdraw, and caused multi-layer blending artifacts (slight flickering
of the grey background) when the login dialog fades in/out.
While the flicker can also be fixed using `set_offscreen_redirect`,
there's no point adding that overhead when the extra layer doesn't need
to be painted. Removing it halves the average render time of the login
animation.
Julian Sparber [Mon, 19 Feb 2024 14:15:48 +0000 (15:15 +0100)]
shell/global: Don't force active workspace for launch context
Since the launch context may also be used to activate an action on an
running application with an already existing window, which we don't
necessarily want to move to a different workspace, don't set a workspace
for the launch context. If no active window exists for an application
then it will be place on the currently active workspace anyways.
Julian Sparber [Mon, 19 Feb 2024 08:30:25 +0000 (09:30 +0100)]
shell/app: Add method to activate an action via FDO DBus activation
There are multiple different places where we activate an app action,
but none set the correct activation token. Therefore this adds an async
method to to call `ActivateAction` on `org.freedesktop.Appliaction`
with the correct activation token/startup id as platform data.
Florian Müllner [Fri, 23 Feb 2024 23:00:34 +0000 (00:00 +0100)]
ci: Don't install entire Development group
With dependencies, the group pulls in about 150 packages. We only
need a tiny tiny subset of that, so only specify what we really
need to not blow up the image size unnecessarily.
We auto-close FDO notifications when the sender leaves the bus,
given that the protocol was created without persistency in mind
and any action will become invalid.
However that broke when moving the public-facing implementation
into a separate service, as we now track the (always running)
service instead of the original sender.
Fix that by forwarding the sender to the internal implementation
via a private hint, just like we already do for the PID.
Florian Müllner [Tue, 20 Feb 2024 18:39:31 +0000 (19:39 +0100)]
notificationDaemon: Namespace private `sender-pid` hint
The hint is a private implementation detail between the public
and internal services, not something anybody else should set
(*cough* libnotify *cough*).
The vfunc was used to register profiling hooks for glx.swapComplete
as we have sysprof nowadays and as that code path is x11 specific
anyways, let us drop it
Julian Sparber [Tue, 20 Feb 2024 10:55:06 +0000 (11:55 +0100)]
components/networkAgent: Fix small mistake
Fixes: c1ff00c01 ("notification: Use the same Source for showing system notifications")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3200>
Ray Strode [Mon, 15 May 2023 14:48:15 +0000 (10:48 -0400)]
authPrompt: Disregard smartcard status changes if VERIFICATION_IN_PROGRESS
commit c8bb45b41c3a13ef161103f649aa18938e028a70 introduced a new
verification state, VERIFICATION_IN_PROGRESS, to detect when the user
has already interacted with the authentication prompt, so the
prompt can rate limit the number of times the user can cancel
authentication attempts with the escape key (without also rate limiting
the number of times they can hit escape to go back to the clock without
interacting with the prompt).
That means there are now two states that represent the user actively
undergoing verification: VERIFYING and VERIFICATION_IN_PROGRESS.
It's inappropriate to reset the smartcard service if the user is
actively conversing with it. We try to check for that by looking at the
original verification state, VERIFYING, but we unfortunately, neglect
to account for the new VERIFICATION_IN_PROGRESS state.
The result is that if a user types their smartcard pin at the clock,
and then inserts their smartcard, the pin will get cleared instead of
used, and they have to retype it again.
This commit fixes the oversight, and allows users to again pre-type
their smartcard pin at the clock before inserting their smartcard.
Florian Müllner [Tue, 17 Dec 2019 19:06:24 +0000 (20:06 +0100)]
sessionMode: Use property spread to sync mode
The parameters here come from a fixed set of mode definitions rather
than a function parameter, so the additional check performed by
Params.parse() isn't relevant here.
As we are slowly moving colors to be represented by a [0, 1] floats.
The unsigned integer variant will likely be removed in the near future, so be
ready for that already
The button that clear notifications is labeled as
"Clear". When using a screen reader, this label
doesn't provide enough context about the action
that will happen.